package com.woniu.shop.mapper;

import com.woniu.shop.pojo.Complaint;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * 用户投诉表 Mapper 接口
 * </p>
 *
 * @author malei
 * @since 2023-02-18
 */
public interface ComplaintMapper extends BaseMapper<Complaint> {

    @Select("select * from t_complaint where shop_id = #{shopID} and complaint_type = #{status} ")
    List<Complaint> queryComplaintByStatus(@Param("shopID") String shopID, @Param("status") String status);

    @Update("UPDATE t_complaint  set shop_reply=#{message},complaint_type = '1' WHERE id=#{id}")
    Boolean replyComplaint(@Param("id") String id, @Param("message") String message);
}
